<template>
	<view class="searchlist">
		<view class="searchlist-list">
			<view style="margin-left: 130px; margin-bottom: 30px;">- 商品列表 -</view>
			<view class="search-list-conter">
					<view class="shop-list-conter"v-for="item in goodslist" v-on:click="navigateTogoods(item._id)">
						
						
						<view class="nr"   >
						
							<view class="nrdiv"  >
								<image :src="item.goods_thumb" mode=""></image>
								<view>{{item.name}}</view>
								<view>￥:  {{item.month_sell_count}}</view>
							</view>
						
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const db = uniCloud.database()
	export default {
		data() {
			return {
				goodslist: '',
				liebiaostyle: {
					color: 'red'
				}
			}
		},
		// computed:{
		// 	liebiao(){
		// 		return this.xuanzhe? '/static/大缩略图列表.png' : '/static/大列表.png'
		// 	}
		// },
		onLoad(options) {
			console.log(options)
			db.collection('opendb-mall-goods').where({
				'name': options.searchWord
			}).get().then((res) => {
				// console.log("这res",res)
				this.goodslist = res.result.data
				console.log(this.goodslist)
			})

		},
		methods: {
			navigateTogoods(id) {
				uni.navigateTo({
					url: `/pages/xiangx/xiangx?id=`+ id
				})
			},
		}
	}
</script>

<style>





.nr {
	         
		text-align: center;
	}
	
	.nrdiv {
		width: 370rpx;
	    height: 360rpx;
		border: #c5c5c5 1px solid;
		float: left;
	}
	
	.nrdiv image {
		width: 300rpx;
		height: 240rpx;
		margin-top: 15rpx;
	}
	
	.nrdiv view:nth-child(2) {
		font-size: 30rpx;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	
	.nrdiv view:nth-child(3) {
		font-size: 20rpx;
		margin-bottom: 10rpx;
		margin-top: 5rpx;
		font-size: 35rpx;
		color: red;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	}
		
</style>